<#include "componentFieldItem.ftl"/>
<template>
    <div class="model-form">
        <el-page-header @back="goBack" content="更新${formBean.model!}">
        </el-page-header>
        <div class="model-content">
            <${formBean.className}Form
                    v-model="form"
                    @submit="updateData"
                    @cancel="goBack"
                    ref="ruleForm"
            />
        </div>
    </div>
</template>

<script setup>
import ${formBean.className}Form from "./form.vue";
import {ref} from "vue";
import {useUpdate} from "@/uses/useUpdate";

const form = ref({
   <#list formBean.fields as item>
     ${item.id!}: ''<#sep>,
    </#list>
})


const ruleForm = ref(null);

const {updateData,goBack}=useUpdate("${formBean.className?uncap_first}",form,ruleForm)

</script>

<style scoped>

</style>